<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNwYbzYjybzTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nw_ybz_yjybz', function (Blueprint $table) {
            $table->id();
            $table->string('manufacturer')->nullable()->comment('设备厂家');
            $table->string('model')->nullable()->comment('设备型号');
            $table->string('architecture')->nullable()->comment('是否国产化（ARM/X86）');
            $table->string('node_type')->nullable()->comment('节点类型（计算/存储/管理）');
            $table->string('network_zone')->nullable()->comment('内/外网');
            $table->date('maintenance_start')->nullable()->comment('维保-开始');
            $table->date('maintenance_end')->nullable()->comment('维保-结束');
            $table->integer('maintenance_remaining_days')->nullable()->comment('维保剩余（天），可为空');
            $table->string('warranty_status')->nullable()->comment('在保/过保');
            $table->string('data_center')->nullable()->comment('所在机房');
            $table->string('rack')->nullable()->comment('机柜');
            $table->smallInteger('start_u')->comment('起始(U)');
            $table->smallInteger('end_u')->comment('终止(U)');
            $table->string('hostname')->comment('主机名称');
            $table->string('host_id')->nullable()->comment('主机ID');
            $table->string('cluster_group')->nullable()->comment('集群/主机组');
            $table->string('management_ip')->nullable()->comment('管理地址');
            $table->string('bmc_ip')->nullable()->comment('BMC地址');
            $table->smallInteger('cpu_cores')->nullable()->comment('CPU核心');
            $table->bigInteger('memory_mb')->nullable()->comment('内存，单位MB');
            $table->text('disk')->nullable()->comment('硬盘');
            $table->string('device_sn')->nullable()->comment('设备SN');
            $table->string('peer_switch_name_1')->nullable()->comment('对端交换机名称');
            $table->string('peer_interface_1')->nullable()->comment('对端接口');
            $table->string('peer_switch_name_2')->nullable()->comment('第二个对端交换机名称，可为空');
            $table->string('peer_interface_2')->nullable()->comment('第二个对端接口，可为空');
            $table->text('remarks')->nullable()->comment('备注，可为空');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nw_ybz_yjybz');
    }
}
